#include "my_lex.h"
#include "parser.h"

int main(){
    My_lex lex;
    std::string input_;
    char ch;
    while (std::cin.get(ch))
    {
        input_ += ch;
    }
    lex.init();
    lex.get_input(input_);
    std::vector<Token *> tokens;
    lex.analysis(tokens);
    int line_nums = lex.line_num();
    bool result;
    std::vector<int> faults;
    Parser parser;
    parser.init(line_nums);
    parser.analysis(tokens, result, faults);
    //std::cout << "analysis finished!" << std::endl;
    parser.print(result, faults);
    //lex.print(tokens);
    return 0;
}